<template>
  <div>
    <div class="btn-submit-box">
      <el-tabs v-model="activeName" class="my-tabs">
        <el-tab-pane label="当前排班" name="manage"></el-tab-pane>
        <el-tab-pane label="开始排班" name="edit" v-hasPermi="['system:scheduling:add']"></el-tab-pane>
      </el-tabs>
      <el-button type="primary" class="btn-submit-line" size="small" plain @click="saveScheduleFn()" v-if="activeName=='edit'">保存设置</el-button>
    </div>
    <Scheduling type="pointDetail" v-if="activeName=='manage'" :pointData="pointData"></Scheduling>
    <SchedulingEdit v-if="activeName=='edit'" ref="Scheduling" :pointData="pointData" :projectData="projectData"          v-hasPermi="['system:scheduling:add']"></SchedulingEdit>
  </div>
</template>

<script>
import Scheduling from "@/components/pointsManage/Scheduling";
import SchedulingEdit from "./schedulingEdit";

export default {
  name: "scheduling",
  props:['pointData', 'projectData'],
  components:{
    Scheduling,
    SchedulingEdit
  },
  data(){
    return{
      activeName: 'manage'
    }
  },
  methods: {
    saveScheduleFn(){
     this.$refs.Scheduling.saveScheduleFn()
    }
  }
}
</script>

<style scoped>
.btn-submit-box{
  position: relative;
}
.btn-submit-line{
  position: absolute;
  top: 4px;
  right: 0;
}
</style>
